Feature: Book Genie Mode - Automated Testing with Detailed Reporting
File name: BookGenie.feature
Relative path: features/BookGenie.feature
Scenario Outline: Book Genie Response Validation with Citation Verification
Error: No book data extracted from BookGenie response.
at CustomWorld.(anonymous) (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:46:15)
at /home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:8:71
at __awaiter (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:4:12)
at CustomWorld.(anonymous) (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:59:12)
=== SCENARIO LOGS: Book Genie Response Validation with Citation Verification === [12:58:27 PM] Navigating to Creative Workspace login page [12:58:30 PM] Homepage visibility: false [12:58:30 PM] ℹ️ Clicking on mode selection dropdown [12:58:34 PM] ✅ Mode selection dropdown clicked successfully [12:58:34 PM] ℹ️ Checking visibility of mode: BookGenieQA [12:58:34 PM] ✅ Mode "BookGenieQA" is visible [12:58:34 PM] ℹ️ Selecting mode: BookGenieQA [12:58:34 PM] ✅ Mode "BookGenieQA" selected successfully [12:58:36 PM] ℹ️ Waiting for mode transition to complete [12:58:36 PM] ℹ️ Typing query: "Suggest 5 books on christmas" [12:59:06 PM] ⚠ ⚠Book Genie mode did not loaded [12:59:06 PM] ℹ️ Preparing to type query: "Suggest 5 books on christmas" [12:59:06 PM] ℹ️ Waiting for chat input to be visible [12:59:06 PM] ℹ️ Clearing chat input [12:59:06 PM] ℹ️ Typing query: "Suggest 5 books on christmas" [12:59:07 PM] ℹ️ Pressing Enter to submit query [12:59:07 PM] ✅ Query submitted successfully: "Suggest 5 books on christmas" [12:59:07 PM] ℹ️ Waiting for AI to complete thinking... [12:59:07 PM] 📋 WAITING FOR AI RESPONSE [12:59:07 PM] ℹ️ Looking for AI thinking indicator... [12:59:07 PM] ℹ️ Waiting for thinking indicator to appear (max 2 minutes) [12:59:09 PM] ✅ ✓ AI thinking indicator appeared - AI is processing the request [12:59:09 PM] ℹ️ Waiting for thinking indicator to disappear (max 5 minutes) [12:59:12 PM] ✅ ✓ AI thinking completed - Response should be ready [12:59:12 PM] ℹ️ 🔍 Checking for "None of the above, just" option... [12:59:12 PM] ℹ️ ✓ "None of the above, just" option not present - proceeding normally [12:59:12 PM] ℹ️ Allowing additional time for response rendering [12:59:15 PM] ✅ AI response wait process completed [12:59:15 PM] ℹ️ Validating response for query: "Suggest 5 books on christmas" [12:59:15 PM] 📋 VALIDATING RESPONSE FOR QUERY: "Suggest 5 books on christmas" [12:59:15 PM] ℹ️ Locating the latest response in chat [12:59:15 PM] ℹ️ Waiting for response to be visible (max 30 seconds) [12:59:15 PM] ✅ Response received - Length: 636 characters [12:59:15 PM] ℹ️ Response preview: Watch Me WorkInterpreting context for your query...That sounds like a lovely theme! To help you find... [12:59:15 PM] ℹ️ Extracting book data from response... [12:59:15 PM] 📋 EXTRACTING BOOK DATA FROM RESPONSE [12:59:15 PM] ℹ️ Locating BookGenie response container [12:59:15 PM] ℹ️ Extracting HTML content from response [12:59:15 PM] ℹ️ HTML content extracted - Length: 9176 characters [12:59:15 PM] ℹ️ Parsing HTML to extract book data [12:59:15 PM] ✅ SUCCESSFULLY EXTRACTED 0 BOOKS [12:59:15 PM] 📋 EXTRACTED BOOKS SUMMARY [12:59:15 PM] 📊 Total books extracted: 0 [12:59:15 PM] 📊 Average relevance score: 0% [12:59:15 PM] ✅ Extracted 0 books from response === END LOGS ===
Scenario Logs: Book Genie Response Validation with Citation Verification
Scenario Outline: Book Genie Response Validation with Citation Verification
CITATION VALIDATION DETAILED REPORT ================================================================================ BOOK: A Christmas Carol ------------------------------------------------------------ ✅ Reason 1: PASS (95%) ✅ Reason 2: PASS (95%) ✅ Reason 3: PASS (95%) BOOK: Anne of Green Gables ------------------------------------------------------------ ❌ Reason 1: FAIL (0%) 📝 Reason: The book is a classic and falls under the genre of JUVENILE FICTION: Holidays & Celebrations / C... 📚 Citation: JUVENILE FICTION: Classics... ⚠️ Citation text not found in reason: "JUVENILE FICTION: Classics" ❌ Reason 2: FAIL (0%) 📝 Reason: The book is a classic and has christmas in its genre_keywords... 📚 Citation: classic literature... ⚠️ Citation text not found in reason: "classic literature" ❌ Reason 3: FAIL (0%) 📝 Reason: The book is about Marilla and Mathew Cuthbert... 📚 Citation: Marilla and Mathew Cuthbert had planned to adopt a boy to help out around Green Gables farm.... ⚠️ Citation text not found in reason: "Marilla and Mathew Cuthbert had planned to adopt a boy to help out around Green Gables farm." BOOK: Max Fernsby and the Infinite Toys ------------------------------------------------------------ ❌ Reason 1: FAIL (0%) 📝 Reason: The book falls under the genre of JUVENILE FICTION: Holidays & Celebrations / Christmas & Ad... 📚 Citation: JUVENILE FICTION: Holidays & Celebrations / Christmas & Advent... ⚠️ Citation text not found in reason: "JUVENILE FICTION: Holidays & Celebrations / Christmas & Advent" ❌ Reason 2: FAIL (0%) 📝 Reason: The book has christmas in its genre_keywords... 📚 Citation: christmas coloring book... ⚠️ Citation text not found in reason: "christmas coloring book" ❌ Reason 3: FAIL (0%) 📝 Reason: The book is a charming, hilarious, illustrated middle grade Christmas tale... 📚 Citation: a charming, hilarious, illustrated middle grade Christmas tale about three friends who join forces w... ⚠️ Citation text not found in reason: "a charming, hilarious, illustrated middle grade Christmas tale about three friends who join forces with the two wayward elves to save the holidays!" SUMMARY: 3/9 reasons passed (33.3%) OVERALL STATUS: FAIL
Citation validation failed: 3/9 passed (33.3%)
Citation Validation Summary: 3/9 passed
📊 Citation Validation Report
Generated on 10/21/2025, 1:02:04 PM
📖 A Christmas Carol
📖 Anne of Green Gables
📖 Max Fernsby and the Infinite Toys
📈 Validation Summary
PER-BOOK AI VALIDATION REPORT - Query: "Suggest 3 books for childrens"
================================================================================
OVERALL RELEVANCE SCORE: 70%
STATUS: FAIL
BOOKS ANALYZED: 3
BOOK 1: "A Christmas Carol"
------------------------------------------------------------
Overall Score: 70%
SECTION SCORES:
Author Information: 70% - Analysis unavailable - API error
Publishing Date: 70% - Analysis unavailable - API error
Why Match Explanations: 70% - Analysis unavailable - API error
Relevance Scores: 70% - Analysis unavailable - API error
DETAILED FEEDBACK:
• AI analysis temporarily unavailable due to service overload
IMPROVEMENT SUGGESTIONS:
• Retry analysis when service is available
================================================================================
BOOK 2: "Anne of Green Gables"
------------------------------------------------------------
Overall Score: 70%
SECTION SCORES:
Author Information: 70% - Analysis unavailable - API error
Publishing Date: 70% - Analysis unavailable - API error
Why Match Explanations: 70% - Analysis unavailable - API error
Relevance Scores: 70% - Analysis unavailable - API error
DETAILED FEEDBACK:
• AI analysis temporarily unavailable due to service overload
IMPROVEMENT SUGGESTIONS:
• Retry analysis when service is available
================================================================================
BOOK 3: "Max Fernsby and the Infinite Toys"
------------------------------------------------------------
Overall Score: 70%
SECTION SCORES:
Author Information: 70% - Analysis unavailable - API error
Publishing Date: 70% - Analysis unavailable - API error
Why Match Explanations: 70% - Analysis unavailable - API error
Relevance Scores: 70% - Analysis unavailable - API error
DETAILED FEEDBACK:
• AI analysis temporarily unavailable due to service overload
IMPROVEMENT SUGGESTIONS:
• Retry analysis when service is available
================================================================================
SUMMARY FEEDBACK:
----------------------------------------
• AI analysis service is temporarily overloaded
• Using fallback analysis with neutral scores
• Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent: [429 Too Many Requests] You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits.
* Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 2
Please retry in 48.543920682s. [{"@type":"type.googleapis.com/google.rpc.QuotaFailure","violations":[{"quotaMetric":"generativelanguage.googleapis.com/generate_content_free_tier_requests","quotaId":"GenerateRequestsPerMinutePerProjectPerModel-FreeTier","quotaDimensions":{"model":"gemini-2.5-pro","location":"global"},"quotaValue":"2"}]},{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Learn more about Gemini API quotas","url":"https://ai.google.dev/gemini-api/docs/rate-limits"}]},{"@type":"type.googleapis.com/google.rpc.RetryInfo","retryDelay":"48s"}]
OVERALL IMPROVEMENT SUGGESTIONS:
----------------------------------------
• Retry the analysis when Gemini API is less busy
• Consider running tests during off-peak hours
• Check Google AI status page for service updates
🤖 PER-BOOK AI Response Relevance Validation
Query: "Suggest 3 books for childrens"
Overall Relevance Score: 70%
Status: FAIL
Books Analyzed: 3
Individual Book Analyses
📖 Book 1: "A Christmas Carol" - 70%
Author Information: 70%
Analysis unavailable - API error
Publishing Date: 70%
Analysis unavailable - API error
Why Match Explanations: 70%
Analysis unavailable - API error
Relevance Scores: 70%
Analysis unavailable - API error
Improvement Suggestions:
📖 Book 2: "Anne of Green Gables" - 70%
Author Information: 70%
Analysis unavailable - API error
Publishing Date: 70%
Analysis unavailable - API error
Why Match Explanations: 70%
Analysis unavailable - API error
Relevance Scores: 70%
Analysis unavailable - API error
Improvement Suggestions:
📖 Book 3: "Max Fernsby and the Infinite Toys" - 70%
Author Information: 70%
Analysis unavailable - API error
Publishing Date: 70%
Analysis unavailable - API error
Why Match Explanations: 70%
Analysis unavailable - API error
Relevance Scores: 70%
Analysis unavailable - API error
Improvement Suggestions:
Summary Feedback
• AI analysis service is temporarily overloaded
• Using fallback analysis with neutral scores
• Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent: [429 Too Many Requests] You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. * Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 2 Please retry in 48.543920682s. [{"@type":"type.googleapis.com/google.rpc.QuotaFailure","violations":[{"quotaMetric":"generativelanguage.googleapis.com/generate_content_free_tier_requests","quotaId":"GenerateRequestsPerMinutePerProjectPerModel-FreeTier","quotaDimensions":{"model":"gemini-2.5-pro","location":"global"},"quotaValue":"2"}]},{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Learn more about Gemini API quotas","url":"https://ai.google.dev/gemini-api/docs/rate-limits"}]},{"@type":"type.googleapis.com/google.rpc.RetryInfo","retryDelay":"48s"}]
Overall Improvement Suggestions
=== SCENARIO LOGS: Book Genie Response Validation with Citation Verification ===
[12:59:24 PM] Navigating to Creative Workspace login page
[12:59:26 PM] Homepage visibility: false
[12:59:26 PM] ℹ️ Clicking on mode selection dropdown
[12:59:30 PM] ✅ Mode selection dropdown clicked successfully
[12:59:30 PM] ℹ️ Checking visibility of mode: BookGenieQA
[12:59:30 PM] ✅ Mode "BookGenieQA" is visible
[12:59:30 PM] ℹ️ Selecting mode: BookGenieQA
[12:59:30 PM] ✅ Mode "BookGenieQA" selected successfully
[12:59:32 PM] ℹ️ Waiting for mode transition to complete
[12:59:32 PM] ℹ️ Typing query: "Suggest 3 books for childrens"
[1:00:02 PM] ⚠ ⚠Book Genie mode did not loaded
[1:00:02 PM] ℹ️ Preparing to type query: "Suggest 3 books for childrens"
[1:00:02 PM] ℹ️ Waiting for chat input to be visible
[1:00:02 PM] ℹ️ Clearing chat input
[1:00:02 PM] ℹ️ Typing query: "Suggest 3 books for childrens"
[1:00:03 PM] ℹ️ Pressing Enter to submit query
[1:00:03 PM] ✅ Query submitted successfully: "Suggest 3 books for childrens"
[1:00:03 PM] ℹ️ Waiting for AI to complete thinking...
[1:00:03 PM] 📋 WAITING FOR AI RESPONSE
[1:00:03 PM] ℹ️ Looking for AI thinking indicator...
[1:00:03 PM] ℹ️ Waiting for thinking indicator to appear (max 2 minutes)
[1:00:05 PM] ✅ ✓ AI thinking indicator appeared - AI is processing the request
[1:00:05 PM] ℹ️ Waiting for thinking indicator to disappear (max 5 minutes)
[1:00:17 PM] ✅ ✓ AI thinking completed - Response should be ready
[1:00:17 PM] ℹ️ 🔍 Checking for "None of the above, just" option...
[1:00:18 PM] ℹ️ ✓ "None of the above, just" option not present - proceeding normally
[1:00:18 PM] ℹ️ Allowing additional time for response rendering
[1:00:21 PM] ✅ AI response wait process completed
[1:00:21 PM] ℹ️ Validating response for query: "Suggest 3 books for childrens"
[1:00:21 PM] 📋 VALIDATING RESPONSE FOR QUERY: "Suggest 3 books for childrens"
[1:00:21 PM] ℹ️ Locating the latest response in chat
[1:00:21 PM] ℹ️ Waiting for response to be visible (max 30 seconds)
[1:00:21 PM] ✅ Response received - Length: 2209 characters
[1:00:21 PM] ℹ️ Response preview: Watch Me WorkInterpreting context for your query...Retrieving Relevant Books for 'books suitable for...
[1:00:21 PM] ℹ️ Extracting book data from response...
[1:00:21 PM] 📋 EXTRACTING BOOK DATA FROM RESPONSE
[1:00:21 PM] ℹ️ Locating BookGenie response container
[1:00:21 PM] ℹ️ Extracting HTML content from response
[1:00:21 PM] ℹ️ HTML content extracted - Length: 26087 characters
[1:00:21 PM] ℹ️ Parsing HTML to extract book data
[1:00:21 PM] ✅ SUCCESSFULLY EXTRACTED 3 BOOKS
[1:00:21 PM] 📋 EXTRACTED BOOKS SUMMARY
[1:00:21 PM] 📚 1. "A Christmas Carol" - Score: 100%%
[1:00:21 PM] 📚 2. "Anne of Green Gables" - Score: 100%%
[1:00:21 PM] 📚 3. "Max Fernsby and the Infinite Toys" - Score: 100%%
[1:00:21 PM] 📊 Total books extracted: 3
[1:00:21 PM] 📊 Average relevance score: 100%
[1:00:21 PM] ✅ Extracted 3 books from response
[1:00:21 PM] ℹ️ Saving 3 books to Excel file: test_results/suggest_3_books_for_childrens.xlsx
[1:00:21 PM] 📋 SAVING BOOKS TO EXCEL FILE
[1:00:21 PM] ℹ️ Target file path: test_results/suggest_3_books_for_childrens.xlsx
[1:00:21 PM] ℹ️ Exporting 3 books to Excel format
[1:00:21 PM] ✅ Book data saved to: test_results/suggest_3_books_for_childrens.xlsx
[1:00:21 PM] 📊 File verified - Size: 17.04 KB
[1:00:21 PM] ✅ ✓ Excel file creation verified successfully
[1:00:21 PM] 📋 STARTING INDIVIDUAL BOOK VALIDATION (3 books) for query: "Suggest 3 books for childrens"
[1:00:21 PM] 📋 📚 VALIDATING BOOK 1: "A Christmas Carol"
[1:00:21 PM] ℹ️ Starting comprehensive book validation
[1:00:21 PM] ℹ️ Validating title: "A Christmas Carol" vs expected: "A Christmas Carol"
[1:00:21 PM] ✅ ✅ TITLE VALIDATION PASSED: "A Christmas Carol"
[1:00:21 PM] ℹ️ Validating score: 100% vs expected: 100%
[1:00:21 PM] ✅ ✅ SCORE VALIDATION PASSED: 100% (expected 100%)
[1:00:21 PM] ✅ ✅ PERFECT SCORE GAP VALIDATION: Book has 100% score and no gap mentioned
[1:00:21 PM] ℹ️ Why-match points: extracted 3 vs expected 3
[1:00:21 PM] ✅ ✅ WHY-MATCH VALIDATION PASSED: 3 points (expected 3)
[1:00:21 PM] ✅ 🎉 BOOK 1 VALIDATION: ALL CHECKS PASSED!
[1:00:21 PM] ℹ️ Book 1 validation completed
[1:00:21 PM] 📋 📚 VALIDATING BOOK 2: "Anne of Green Gables"
[1:00:21 PM] ℹ️ Starting comprehensive book validation
[1:00:21 PM] ℹ️ Validating title: "Anne of Green Gables" vs expected: "Anne of Green Gables"
[1:00:21 PM] ✅ ✅ TITLE VALIDATION PASSED: "Anne of Green Gables"
[1:00:21 PM] ℹ️ Validating score: 100% vs expected: 100%
[1:00:21 PM] ✅ ✅ SCORE VALIDATION PASSED: 100% (expected 100%)
[1:00:21 PM] ✅ ✅ PERFECT SCORE GAP VALIDATION: Book has 100% score and no gap mentioned
[1:00:21 PM] ℹ️ Why-match points: extracted 3 vs expected 3
[1:00:21 PM] ✅ ✅ WHY-MATCH VALIDATION PASSED: 3 points (expected 3)
[1:00:21 PM] ✅ 🎉 BOOK 2 VALIDATION: ALL CHECKS PASSED!
[1:00:21 PM] ℹ️ Book 2 validation completed
[1:00:21 PM] 📋 📚 VALIDATING BOOK 3: "Max Fernsby and the Infinite Toys"
[1:00:21 PM] ℹ️ Starting comprehensive book validation
[1:00:21 PM] ℹ️ Validating title: "Max Fernsby and the Infinite Toys" vs expected: "Max Fernsby and the Infinite Toys"
[1:00:21 PM] ✅ ✅ TITLE VALIDATION PASSED: "Max Fernsby and the Infinite Toys"
[1:00:21 PM] ℹ️ Validating score: 100% vs expected: 100%
[1:00:21 PM] ✅ ✅ SCORE VALIDATION PASSED: 100% (expected 100%)
[1:00:21 PM] ✅ ✅ PERFECT SCORE GAP VALIDATION: Book has 100% score and no gap mentioned
[1:00:21 PM] ℹ️ Why-match points: extracted 3 vs expected 3
[1:00:21 PM] ✅ ✅ WHY-MATCH VALIDATION PASSED: 3 points (expected 3)
[1:00:21 PM] ✅ 🎉 BOOK 3 VALIDATION: ALL CHECKS PASSED!
[1:00:21 PM] ℹ️ Book 3 validation completed
[1:00:21 PM] 📊 VALIDATION SUMMARY: 3/3 books passed
[1:00:21 PM] ✅ ALL BOOKS VALIDATED SUCCESSFULLY!
[1:00:21 PM] 📋 🔍 VALIDATING REASON-CITATION MATCHES
[1:00:21 PM] ℹ️ Starting citation validation process...
[1:00:21 PM] 📋 🚀 STARTING COMPLETE CITATION VALIDATION WORKFLOW
[1:00:21 PM] ℹ️ Step 1: Extracting books from AI response
[1:00:21 PM] 📋 EXTRACTING BOOK DATA FROM RESPONSE
[1:00:21 PM] ℹ️ Locating BookGenie response container
[1:00:21 PM] ℹ️ Extracting HTML content from response
[1:00:21 PM] ℹ️ HTML content extracted - Length: 26087 characters
[1:00:21 PM] ℹ️ Parsing HTML to extract book data
[1:00:21 PM] ✅ SUCCESSFULLY EXTRACTED 3 BOOKS
[1:00:21 PM] 📋 EXTRACTED BOOKS SUMMARY
[1:00:21 PM] 📚 1. "A Christmas Carol" - Score: 100%%
[1:00:21 PM] 📚 2. "Anne of Green Gables" - Score: 100%%
[1:00:21 PM] 📚 3. "Max Fernsby and the Infinite Toys" - Score: 100%%
[1:00:21 PM] 📊 Total books extracted: 3
[1:00:21 PM] 📊 Average relevance score: 100%
[1:00:21 PM] ℹ️ Step 2: Extracting citation texts from book elements
[1:00:21 PM] 📋 📚 EXTRACTING CITATION TEXTS FROM BOOK ELEMENTS
[1:00:21 PM] ℹ️ Step 1: Waiting for main book section
[1:00:21 PM] ℹ️ Found 7 total accordion sections
[1:00:21 PM] ℹ️ Found individual book: "1. A Christmas Carol"
[1:00:21 PM] ℹ️ Found individual book: "2. Anne of Green Gables"
[1:00:21 PM] ℹ️ Found individual book: "3. Max Fernsby and the Infinite Toys"
[1:00:21 PM] ℹ️ Processing 3 individual book sections
[1:00:21 PM] 📋 📖 PROCESSING BOOK 1: "A Christmas Carol"
[1:00:21 PM] ℹ️ Expanding book section: "A Christmas Carol"
[1:00:24 PM] ✅ Book section expanded: "A Christmas Carol"
[1:00:24 PM] ℹ️ Expanding "Why this book is the match" section for: "A Christmas Carol"
[1:00:27 PM] ✅ "Why this book is the match" section expanded for: "A Christmas Carol"
[1:00:27 PM] ℹ️ Found 3 citation buttons for "A Christmas Carol"
[1:00:27 PM] ℹ️ Extracting citation 1/3 for "A Christmas Carol"
[1:00:27 PM] ℹ️ Processing metadata citation 1 for "A Christmas Carol"
[1:00:28 PM] ℹ️ Clicking to OPEN metadata citation 1
[1:00:30 PM] ℹ️ Extracted citation text (first 100 chars): christmas books...
[1:00:30 PM] ℹ️ Clicking to CLOSE metadata citation 1
[1:00:31 PM] ✅ ✅ metadata citation 1 closed successfully
[1:00:31 PM] ℹ️ ✅ Citation 1 extracted successfully (length: 15)
[1:00:31 PM] ℹ️ Extracting citation 2/3 for "A Christmas Carol"
[1:00:32 PM] ℹ️ Processing metadata citation 2 for "A Christmas Carol"
[1:00:33 PM] ℹ️ Clicking to OPEN metadata citation 2
[1:00:35 PM] ℹ️ Extracted citation text (first 100 chars): JUVENILE FICTION: Holidays & Celebrations / Christmas & Advent...
[1:00:35 PM] ℹ️ Clicking to CLOSE metadata citation 2
[1:00:36 PM] ✅ ✅ metadata citation 2 closed successfully
[1:00:36 PM] ℹ️ ✅ Citation 2 extracted successfully (length: 62)
[1:00:36 PM] ℹ️ Extracting citation 3/3 for "A Christmas Carol"
[1:00:36 PM] ℹ️ Processing metadata citation 3 for "A Christmas Carol"
[1:00:37 PM] ℹ️ Clicking to OPEN metadata citation 3
[1:00:39 PM] ℹ️ Extracted citation text (first 100 chars): On a cold, blustery Christmas Eve, Ebenezer Scrooge toils in his countinghouse, unable to give a kin...
[1:00:39 PM] ℹ️ Clicking to CLOSE metadata citation 3
[1:00:41 PM] ✅ ✅ metadata citation 3 closed successfully
[1:00:41 PM] ℹ️ ✅ Citation 3 extracted successfully (length: 124)
[1:00:41 PM] ℹ️ Collapsing book section: "A Christmas Carol"
[1:00:42 PM] ✅ Book section collapsed: "A Christmas Carol"
[1:00:42 PM] ✅ ✅ Completed processing "A Christmas Carol" - 3 citations extracted
[1:00:42 PM] 📋 📖 PROCESSING BOOK 2: "Anne of Green Gables"
[1:00:42 PM] ℹ️ Expanding book section: "Anne of Green Gables"
[1:00:45 PM] ✅ Book section expanded: "Anne of Green Gables"
[1:00:45 PM] ℹ️ Expanding "Why this book is the match" section for: "Anne of Green Gables"
[1:00:48 PM] ✅ "Why this book is the match" section expanded for: "Anne of Green Gables"
[1:00:48 PM] ℹ️ Found 3 citation buttons for "Anne of Green Gables"
[1:00:48 PM] ℹ️ Extracting citation 1/3 for "Anne of Green Gables"
[1:00:48 PM] ℹ️ Processing metadata citation 1 for "Anne of Green Gables"
[1:00:49 PM] ℹ️ Clicking to OPEN metadata citation 1
[1:00:51 PM] ℹ️ Extracted citation text (first 100 chars): JUVENILE FICTION: Classics...
[1:00:51 PM] ℹ️ Clicking to CLOSE metadata citation 1
[1:00:53 PM] ✅ ✅ metadata citation 1 closed successfully
[1:00:53 PM] ℹ️ ✅ Citation 1 extracted successfully (length: 26)
[1:00:53 PM] ℹ️ Extracting citation 2/3 for "Anne of Green Gables"
[1:00:53 PM] ℹ️ Processing metadata citation 2 for "Anne of Green Gables"
[1:00:54 PM] ℹ️ Clicking to OPEN metadata citation 2
[1:00:56 PM] ℹ️ Extracted citation text (first 100 chars): classic literature...
[1:00:56 PM] ℹ️ Clicking to CLOSE metadata citation 2
[1:00:58 PM] ✅ ✅ metadata citation 2 closed successfully
[1:00:58 PM] ℹ️ ✅ Citation 2 extracted successfully (length: 18)
[1:00:58 PM] ℹ️ Extracting citation 3/3 for "Anne of Green Gables"
[1:00:58 PM] ℹ️ Processing metadata citation 3 for "Anne of Green Gables"
[1:00:59 PM] ℹ️ Clicking to OPEN metadata citation 3
[1:01:01 PM] ℹ️ Extracted citation text (first 100 chars): Marilla and Mathew Cuthbert had planned to adopt a boy to help out around Green Gables farm....
[1:01:01 PM] ℹ️ Clicking to CLOSE metadata citation 3
[1:01:02 PM] ✅ ✅ metadata citation 3 closed successfully
[1:01:02 PM] ℹ️ ✅ Citation 3 extracted successfully (length: 92)
[1:01:02 PM] ℹ️ Collapsing book section: "Anne of Green Gables"
[1:01:04 PM] ✅ Book section collapsed: "Anne of Green Gables"
[1:01:04 PM] ✅ ✅ Completed processing "Anne of Green Gables" - 3 citations extracted
[1:01:04 PM] 📋 📖 PROCESSING BOOK 3: "Max Fernsby and the Infinite Toys"
[1:01:04 PM] ℹ️ Expanding book section: "Max Fernsby and the Infinite Toys"
[1:01:07 PM] ✅ Book section expanded: "Max Fernsby and the Infinite Toys"
[1:01:07 PM] ℹ️ Expanding "Why this book is the match" section for: "Max Fernsby and the Infinite Toys"
[1:01:10 PM] ✅ "Why this book is the match" section expanded for: "Max Fernsby and the Infinite Toys"
[1:01:10 PM] ℹ️ Found 3 citation buttons for "Max Fernsby and the Infinite Toys"
[1:01:10 PM] ℹ️ Extracting citation 1/3 for "Max Fernsby and the Infinite Toys"
[1:01:10 PM] ℹ️ Processing metadata citation 1 for "Max Fernsby and the Infinite Toys"
[1:01:11 PM] ℹ️ Clicking to OPEN metadata citation 1
[1:01:13 PM] ℹ️ Extracted citation text (first 100 chars): JUVENILE FICTION: Holidays & Celebrations / Christmas & Advent...
[1:01:13 PM] ℹ️ Clicking to CLOSE metadata citation 1
[1:01:14 PM] ✅ ✅ metadata citation 1 closed successfully
[1:01:14 PM] ℹ️ ✅ Citation 1 extracted successfully (length: 62)
[1:01:14 PM] ℹ️ Extracting citation 2/3 for "Max Fernsby and the Infinite Toys"
[1:01:14 PM] ℹ️ Processing metadata citation 2 for "Max Fernsby and the Infinite Toys"
[1:01:15 PM] ℹ️ Clicking to OPEN metadata citation 2
[1:01:18 PM] ℹ️ Extracted citation text (first 100 chars): christmas coloring book...
[1:01:18 PM] ℹ️ Clicking to CLOSE metadata citation 2
[1:01:19 PM] ✅ ✅ metadata citation 2 closed successfully
[1:01:19 PM] ℹ️ ✅ Citation 2 extracted successfully (length: 23)
[1:01:19 PM] ℹ️ Extracting citation 3/3 for "Max Fernsby and the Infinite Toys"
[1:01:19 PM] ℹ️ Processing metadata citation 3 for "Max Fernsby and the Infinite Toys"
[1:01:20 PM] ℹ️ Clicking to OPEN metadata citation 3
[1:01:22 PM] ℹ️ Extracted citation text (first 100 chars): a charming, hilarious, illustrated middle grade Christmas tale about three friends who join forces w...
[1:01:22 PM] ℹ️ Clicking to CLOSE metadata citation 3
[1:01:24 PM] ✅ ✅ metadata citation 3 closed successfully
[1:01:24 PM] ℹ️ ✅ Citation 3 extracted successfully (length: 147)
[1:01:24 PM] ℹ️ Collapsing book section: "Max Fernsby and the Infinite Toys"
[1:01:25 PM] ✅ Book section collapsed: "Max Fernsby and the Infinite Toys"
[1:01:25 PM] ✅ ✅ Completed processing "Max Fernsby and the Infinite Toys" - 3 citations extracted
[1:01:25 PM] ✅ 🎉 Successfully extracted citations from 3 books
[1:01:25 PM] ℹ️ Step 3: Validating reason-citation matches
[1:01:25 PM] 📋 🔍 VALIDATING REASON-CITATION MATCHES (80% THRESHOLD)
[1:01:25 PM] ℹ️ 📖 Validating 3 reasons for: "A Christmas Carol"
[1:01:25 PM] ℹ️ Reason 1: Checking match...
[1:01:43 PM] ✅ ✅ "A Christmas Carol" - Reason 1: 95% match - PASS
[1:01:43 PM] ℹ️ Reason 2: Checking match...
[1:01:54 PM] ✅ ✅ "A Christmas Carol" - Reason 2: 95% match - PASS
[1:01:54 PM] ℹ️ Reason 3: Checking match...
[1:02:03 PM] ✅ ✅ "A Christmas Carol" - Reason 3: 95% match - PASS
[1:02:03 PM] ℹ️ 📖 Validating 3 reasons for: "Anne of Green Gables"
[1:02:03 PM] ℹ️ Reason 1: Checking match...
[1:02:03 PM] ❌ ❌ "Anne of Green Gables" - Reason 1: 0% match - FAIL
[1:02:03 PM] ❌ ⚠️ Citation text not found in reason: "JUVENILE FICTION: Classics"
[1:02:03 PM] ℹ️ Reason 2: Checking match...
[1:02:03 PM] ❌ ❌ "Anne of Green Gables" - Reason 2: 0% match - FAIL
[1:02:03 PM] ❌ ⚠️ Citation text not found in reason: "classic literature"
[1:02:03 PM] ℹ️ Reason 3: Checking match...
[1:02:03 PM] ❌ ❌ "Anne of Green Gables" - Reason 3: 0% match - FAIL
[1:02:03 PM] ❌ ⚠️ Citation text not found in reason: "Marilla and Mathew Cuthbert had planned to adopt a boy to help out around Green Gables farm."
[1:02:03 PM] ℹ️ 📖 Validating 3 reasons for: "Max Fernsby and the Infinite Toys"
[1:02:03 PM] ℹ️ Reason 1: Checking match...
[1:02:04 PM] ❌ ❌ "Max Fernsby and the Infinite Toys" - Reason 1: 0% match - FAIL
[1:02:04 PM] ❌ ⚠️ Citation text not found in reason: "JUVENILE FICTION: Holidays & Celebrations / Christmas & Advent"
[1:02:04 PM] ℹ️ Reason 2: Checking match...
[1:02:04 PM] ❌ ❌ "Max Fernsby and the Infinite Toys" - Reason 2: 0% match - FAIL
[1:02:04 PM] ❌ ⚠️ Citation text not found in reason: "christmas coloring book"
[1:02:04 PM] ℹ️ Reason 3: Checking match...
[1:02:04 PM] ❌ ❌ "Max Fernsby and the Infinite Toys" - Reason 3: 0% match - FAIL
[1:02:04 PM] ❌ ⚠️ Citation text not found in reason: "a charming, hilarious, illustrated middle grade Christmas tale about three friends who join forces with the two wayward elves to save the holidays!"
[1:02:04 PM] 📊 📊 CITATION VALIDATION SUMMARY: 3/9 passed (33.3%)
[1:02:04 PM] ❌ 💥 REASON-CITATION VALIDATION: OVERALL FAILED
[1:02:04 PM] ℹ️ Step 4: Generating detailed report
[1:02:04 PM] 📋 📋 GENERATING CITATION VALIDATION REPORT
[1:02:04 PM] ℹ️ Report generated: 3/9 reasons passed
[1:02:04 PM] ✅ ✅ Citation validation workflow completed successfully
[1:02:04 PM] 📊 📈 OVERALL CITATION VALIDATION: 3/9 (33.3%)
[1:02:04 PM] ❌ ❌ REASON-CITATION VALIDATION: OVERALL FAILED - Only 33.3% of reasons match citations (required: 80%)
[1:02:04 PM] 📋 📋 GENERATING DETAILED CITATION VALIDATION REPORT
[1:02:04 PM] ℹ️ Generating HTML citation validation report
[1:02:04 PM] ✅ Generated HTML report for 9 reasons
[1:02:04 PM] ✅ ✅ Citation validation HTML report generated and attached
[1:02:04 PM] ✅ ✅ Citation validation plain text report attached
[1:02:04 PM] ℹ️ Checking database connectivity...
[1:02:04 PM] ✅ ✅ Database connected successfully
[1:02:04 PM] ℹ️ Database path: /home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/test_data/database.xlsx
[1:02:04 PM] ℹ️ Total books: 10032
[1:02:04 PM] 📊 Database contains 10032 books
[1:02:04 PM] ✅ ✅ Database book count requirement met: 10032 >= 10032
[1:02:04 PM] 📋 🔍 VALIDATING EXTRACTED BOOKS INDIVIDUALLY AGAINST DATABASE
[1:02:04 PM] ℹ️ Checking book 1/3: "A Christmas Carol"
[1:02:04 PM] ℹ️ Checking if book exists in database: "A Christmas Carol"
[1:02:04 PM] ✅ ✅ Database match: "A Christmas Carol" → "A Christmas Carol"
[1:02:04 PM] ℹ️ Checking book 2/3: "Anne of Green Gables"
[1:02:04 PM] ℹ️ Checking if book exists in database: "Anne of Green Gables"
[1:02:05 PM] ✅ ✅ Database match: "Anne of Green Gables" → "Anne of Green Gables"
[1:02:05 PM] ℹ️ Checking book 3/3: "Max Fernsby and the Infinite Toys"
[1:02:05 PM] ℹ️ Checking if book exists in database: "Max Fernsby and the Infinite Toys"
[1:02:05 PM] ✅ ✅ Database match: "Max Fernsby and the Infinite Toys" → "Max Fernsby and the Infinite Toys"
[1:02:05 PM] 📊 INDIVIDUAL DATABASE VALIDATION SUMMARY: 3/3 books found in database
[1:02:05 PM] ✅ 🎉 ALL BOOKS VALIDATED SUCCESSFULLY AGAINST DATABASE!
[1:02:05 PM] 📋 🤖 VALIDATING RESPONSE RELEVANCE WITH GEMINI AI - PER BOOK ANALYSIS
[1:02:05 PM] ℹ️ Starting Gemini AI per-book relevance validation...
[1:02:05 PM] 📋 🤖 ANALYZING RESPONSE RELEVANCE WITH GEMINI AI - PER BOOK ANALYSIS
[1:02:05 PM] ℹ️ Starting Gemini AI analysis with retry logic...
[1:02:11 PM] ⚠ ⚠️ GEMINI VALIDATION: Using fallback analysis due to API issues
[1:02:11 PM] ℹ️ Overall Score: 70% (Fallback)
[1:02:11 PM] 📋 📖 ANALYSIS FOR: "A Christmas Carol" - Score: 70%
[1:02:11 PM] ℹ️ ❌ Author Information: 70% - Analysis unavailable - API error
[1:02:11 PM] ℹ️ ❌ Publishing Date: 70% - Analysis unavailable - API error
[1:02:11 PM] ℹ️ ❌ Why Match Explanations: 70% - Analysis unavailable - API error
[1:02:11 PM] ℹ️ ❌ Relevance Scores: 70% - Analysis unavailable - API error
[1:02:11 PM] ℹ️ 💡 Book-specific improvements:
[1:02:11 PM] ℹ️ - Retry analysis when service is available
[1:02:11 PM] 📋 📖 ANALYSIS FOR: "Anne of Green Gables" - Score: 70%
[1:02:11 PM] ℹ️ ❌ Author Information: 70% - Analysis unavailable - API error
[1:02:11 PM] ℹ️ ❌ Publishing Date: 70% - Analysis unavailable - API error
[1:02:11 PM] ℹ️ ❌ Why Match Explanations: 70% - Analysis unavailable - API error
[1:02:11 PM] ℹ️ ❌ Relevance Scores: 70% - Analysis unavailable - API error
[1:02:11 PM] ℹ️ 💡 Book-specific improvements:
[1:02:11 PM] ℹ️ - Retry analysis when service is available
[1:02:11 PM] 📋 📖 ANALYSIS FOR: "Max Fernsby and the Infinite Toys" - Score: 70%
[1:02:11 PM] ℹ️ ❌ Author Information: 70% - Analysis unavailable - API error
[1:02:11 PM] ℹ️ ❌ Publishing Date: 70% - Analysis unavailable - API error
[1:02:11 PM] ℹ️ ❌ Why Match Explanations: 70% - Analysis unavailable - API error
[1:02:11 PM] ℹ️ ❌ Relevance Scores: 70% - Analysis unavailable - API error
[1:02:11 PM] ℹ️ 💡 Book-specific improvements:
[1:02:11 PM] ℹ️ - Retry analysis when service is available
[1:02:11 PM] ℹ️ 📊 SUMMARY FEEDBACK:
[1:02:11 PM] ℹ️ • AI analysis service is temporarily overloaded
[1:02:11 PM] ℹ️ • Using fallback analysis with neutral scores
[1:02:11 PM] ℹ️ • Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent: [429 Too Many Requests] You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits.
* Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 2
Please retry in 48.543920682s. [{"@type":"type.googleapis.com/google.rpc.QuotaFailure","violations":[{"quotaMetric":"generativelanguage.googleapis.com/generate_content_free_tier_requests","quotaId":"GenerateRequestsPerMinutePerProjectPerModel-FreeTier","quotaDimensions":{"model":"gemini-2.5-pro","location":"global"},"quotaValue":"2"}]},{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Learn more about Gemini API quotas","url":"https://ai.google.dev/gemini-api/docs/rate-limits"}]},{"@type":"type.googleapis.com/google.rpc.RetryInfo","retryDelay":"48s"}]
[1:02:11 PM] ❌ ❌ GEMINI AI VALIDATION FAILED: 70% relevance score (required: 80%)
[1:02:11 PM] ℹ️ Continuing execution due to soft assertion...
=== END LOGS ===